import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import * as path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    //设置别名
    alias: {
      '@': path.resolve(__dirname, 'src'),
      'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',

    }
  },
  plugins: [vue()],


  server: {
    port: 3000, //启动端口

    //模块热替换
    // hmr: {
    //   host: "0.0.0.0",
    //   port: 3001,
    // },

    proxy: {
      "/api": {
        target: "http://192.168.100.22:3001",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },

  }


  
});


